package com.example.afinal.Xrich;

import android.widget.ImageView;

import com.sendtion.xrichtext.IImageLoader;

public class XRichText {
    private static com.sendtion.xrichtext.XRichText instance;
    private IImageLoader imageLoader;

    public static com.sendtion.xrichtext.XRichText getInstance(){
        if (instance == null){
            synchronized (com.sendtion.xrichtext.XRichText.class){
                if (instance == null){
                    instance = new com.sendtion.xrichtext.XRichText();
                }
            }
        }
        return instance;
    }

    public void setImageLoader(IImageLoader imageLoader){
        this.imageLoader = imageLoader;
    }

    public void loadImage(String imagePath, ImageView imageView, int imageHeight){
        if (imageLoader != null){
            imageLoader.loadImage(imagePath, imageView, imageHeight);
        }
    }
}
